package com.weeego.web.service.impl;

import java.io.Serializable;

import com.sql.weeego.bean.base.CenterNews;
import com.weeego.util.string.Reg;
import com.weeego.web.base.BaseServiceImpl;
import com.weeego.web.service.CentterNewsTypeService;

/**
 * 
 * @author zuaa
 */
public class CenterNewsServiceImpl extends BaseServiceImpl implements
		CentterNewsTypeService {

	@Override
	public Serializable saveOrUpdate(Serializable serializable) {

		CenterNews _CenterNews = new CenterNews(serializable);
		// edit tag
		// if tag spite with | space : then replace it to ,
		String tag = _CenterNews.getTag();
		// replae spaces to space
		tag = Reg.replaceReg(tag);
		tag = tag.replace(" ", ",");
		tag = tag.replace("|", ",");
		tag = tag.replace(":", ",");
		//replace many , to ,
		tag=Reg.replaceReg(tag,	",{2,}");
		_CenterNews.setTag(tag);
		return super.saveOrUpdate(_CenterNews);
	}

}
